-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
less: enable options to be specified multiple times #8204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
7f9f692 to
9e9aca9
Compare
|
if order matters, maybe "options" should be made into a list instead of an attrset. I applaud what you've done but I fear this makes more complex. Let's see what @Pamplemousse thinks |
List or using |
9e9aca9 to
1e294f1
Compare
1e294f1 to
afc3090
Compare
|
Ok, thank you for the input. I went for the list approach. And by coercing the attrs to a list with |
| { | ||
| programs.less = { | ||
| enable = true; | ||
| options = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend trying to use both a list and attrset with mkBefore/mkAfter.
But otherwise LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend trying to use both a list and attrset with
mkBefore/mkAfter.
Wow, I did not know that you could use mkBefore/mkAfter on attrsets because they do not have any notion of order. This implies that there is no need to change anything to solve the order issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't, attrset is still lexicographically ordered.
But the list it will be coerced to should use the module order that was applied to the option?
afc3090 to
803a72f
Compare
Description
This PR fixes two things in the
programs.lessmodule:The--color/-Dand--prompt/-Poptions need to occur in a certain order (see the comments in the code and theless(1)man page for more information)Checklist
Change is backwards compatible.
Code formatted with
nix fmtornix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.Code tested through
nix run .#tests -- test-allornix-shell --pure tests -A run.all.Test cases updated/added. See example.
Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.